<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ICClub 活动创建</title>
    <link rel="shortcut icon " type="images/x-icon" href="../static/images/favicon1.png">


    <link rel="stylesheet" href="../static/css/general.css">
    <link rel="stylesheet" href="../static/css/header.css">
    <link rel="stylesheet" href="../static/css/icclub.css">

    <link rel="stylesheet" href="../static/css/changelabel.css">
    <link rel="stylesheet" href="../static/css/active_user.css">
    <link rel="stylesheet" href="../static/css/footer.css">
    <link rel="stylesheet" href="../static/css/css.css">
    <link rel="stylesheet" href="../static/css/baidu.css">
    <script src="../static/js/jquery.min.js"></script>
    <script src="../static/js/base_con.js"></script>
    <script src="../static/js/tool_kit.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=GK8muKdwK0w3So6HW89F8KlHc5BKzdbL"></script>
</head>
<body>
<div id="mapp" style="display: none">
    <div id="inp">
        <input type="text" id="intext" placeholder="在这里输入关键字进行查询">
        <button id="qran">确认</button>
        <button id="qdan">提交地址</button>
    </div>
    <div id="allmap"></div>
</div>
<!-- 嵌入导航栏模板 -->
<div id="head"></div>

<div id="box2">
    <!-- box2左窗口 -->
    <div id="box2_left">
        <div id="wrapper">
            <div class="create_active">
                <h2>创建活动</h2>
            </div>


            <div class="select-kind">
                <label>活动主题</label>
                <select name="kind" id="kind">
                </select>
            </div>

            <div class="title">
                <label>活动标题</label>
                <input type="text" required='required' placeholder="必填项" name="title" id="title" maxlength="22">
            </div>

            <div class="time">
                <label>开始时间</label>
                <input type="date" type="datetime-local" id="start-time" required='required'></br>
                <label>结束时间</label>
                <input type="date" type="datetime-local" id="end-time" required='required'>
            </div>


        </div>

        <div id="wrapper_down">


            <div class="local">
                <label>活动地点</label>
                <div class="full-address">
                    <input type="text" id="addr" name="full-address" placeholder="请输入详细地址(必填项)">
                    <button id="mapsearch">地图搜索</button>
                </div>

            </div>


            <div class="act_person">
                <label for="">活动人数</label>
                <input type="text" id="condition" name="condition" placeholder="活动达成条件下限">
            </div>


            <div class="add_img">
                <div class="intros">
                    <label>活动详情</label>
                    <input type="file" id="myfile" name="myfile">

                </div>
                <div class="intros_text">
                    <textarea name="intro" id="act_intros" cols="25" rows="10" required='required'></textarea>
                </div>
            </div>


            <div class="submit">
                <button id="add_act">创建</button>
                <button id="quxiao">取消</button>
            </div>


        </div>
    </div>


    <!-- box2右窗口 -->
    <div id="box2_right">
        <!-- box2右窗口上 -->
        <div id="box2_right_up">
            <!-- 右上标题 -->
            <div class="b2_right1">
                <p id="ac_c">活动推荐</p>
                <div id="btn_l">
                    <span id="lab_btn">换一换</span>
                </div>
                <div id="c_label">
                    <ul id="lab">

                    </ul>
                </div>
            </div>
        </div>
        <!-- box2右窗口下 -->
        <div id="box2_right_down">
            <!-- 右下标题 -->
            <div class="b2_right1">
                <p>活跃达人</p>
                <!-- 调试 显示8个 -->
                <!-- <span id="_btn">测试添加8个</span> -->
            </div>
            <!-- 活跃达人列表 -->
            <div id="b2_actv_user">
                <!-- 用ajax请求渲染 -->
            </div>
        </div>
    </div>

</div>


<div id="foot"></div>

    <script>

        $("#foot").load("footer.html");
    </script>
    <script src="../static/js/header.js"></script>
    <script src="../static/js/active_user.js"></script>
    <script src="../static/js/baidu.js"></script>
    <script src="../static/js/tips.js"></script>
    <script src="../static/js/create_act.js"></script>

<script>



    // 选择地址
    var $prov = $('#prov');
    var $city = $('#city');
    var $area = $('#area');



    $prov.on('change', function () {
        $.each(city, function (i, d) {
            if ($prov.val() == d.pid) {
                $citys.html('<option value="">请选择</option>');
                //对市遍历
                $.each(d.citys, function (i, d2) {
                    $city.append('<option value="' + d2.cid + '">'
                        + d2.city_name + '</option>')
                })
            }
        })

    })

    $city.on("change", function () {
        $.each(data, function (i, e) {
            //如果选择的省份值与遍历时的某个值相等，则获取它的城市
            if ($priv.val() == e.provId) {
                $.each(e.citys, function (i, e2) {
                    //如果选择的城市值与遍历时的某个值相等，则获取它的区县
                    if ($city.val() == e2.cityId) {
                        //清空原来数据
                        $area.html("");
                        $.each(e2.areas, function (i, e3) {
                            $area.append("<option value='" + e3.areaId + "'>" + e3.areaname + "</option>")
                        })
                    }
                })
            }
        })
        if ($city.val() == 0) {
            $area.html("<option value='0'>请选择</option>")
        }
    });


    $city.append('<option value="">请选择</option>');
    $area.append('<option value="">请选择</option>');


</script>

<script>
    getFocus($('#l3 a'));
</script>
</body>
</html>
